<html>
<head><meta charset="utf-8"><title>Harmonic synthesis · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html">Harmonic synthesis</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239721742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/239721742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#239721742">(May 21 2021 at 09:29)</a>:</h4>
<p>I also wanted to point people at this <a href="https://hackmd.io/YkY-62ZRQ9uevOD6iF7e0w?view">draft document</a> that <span class="user-mention" data-user-id="116883">@tmandry</span> and I have been working on. It contains a kind of "synthesized roadmap" of what we think it would take to make async a joy to use. This is not prioritized yet. The structure is a kind of "skill tree", where each section repesents a "goal", with a description of what it will feel like when it's achieved along with a list of what work it requires to get there. In some cases, the work is very specific, but in other cases, the work is an open problem, in which case we describe its goals for the most part.  I think that in the final vision doc, each of these sections would basically be a distinct "shiny future story".</p>



<a name="239721769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/239721769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#239721769">(May 21 2021 at 09:29)</a>:</h4>
<p>The document isn't quite complete yet, I'm still toying with ways to represent the information more visually.</p>



<a name="239722256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/239722256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#239722256">(May 21 2021 at 09:34)</a>:</h4>
<p>Just a little bit of work to get there <span aria-label="lol" class="emoji emoji-1f606" role="img" title="lol">:lol:</span></p>



<a name="241304551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241304551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241304551">(Jun 02 2021 at 19:03)</a>:</h4>
<p>So I opened <a href="https://github.com/rust-lang/wg-async-foundations/pull/215">a PR</a> which includes a link to this <a href="https://nikomatsakis.github.io/wg-async-foundations/vision/harmonic.html">rendered form</a>. This is a kind of "rough draft" pulling together some of the work that <span class="user-mention" data-user-id="116883">@tmandry</span> and I did towards forming a structure around the "shiny future" (the so-called "harmonic synthesis"). It's really meant to describe the experience we are shooting for and to give some structure around the major components needed to achieve it.</p>



<a name="241304622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241304622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241304622">(Jun 02 2021 at 19:04)</a>:</h4>
<p>I'm trying to think what kind of feedback I want here :)</p>



<a name="241304798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241304798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241304798">(Jun 02 2021 at 19:06)</a>:</h4>
<p>I guess there's a few questions:</p>
<ul>
<li><em>If</em> we could achieve the <a href="https://nikomatsakis.github.io/wg-async-foundations/vision/harmonic.html#some-specific-technical-challenges">specific technical challenges</a>, do we agree that we would generally be experiencing the "shiny future" as described?</li>
</ul>



<a name="241304801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241304801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241304801">(Jun 02 2021 at 19:06)</a>:</h4>
<ul>
<li>Are there items in this list that we think are <em>not</em> good thngs to solve? (e.g., we should never have generators) If not, why not? I hope to create documents collecting my notes for many of these items and some of the dead-ends that we've encountered trying to fix them.</li>
</ul>



<a name="241304902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241304902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241304902">(Jun 02 2021 at 19:06)</a>:</h4>
<ul>
<li>Shiny future stories -- maybe try to write up parts of this in narrative form -- or some other goals. What might it feel like and look like? It's ok if it's not all figured out.</li>
</ul>



<a name="241305278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241305278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241305278">(Jun 02 2021 at 19:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis/near/241304801">said</a>:</p>
<blockquote>
<ul>
<li>Are there items in this list that we think are <em>not</em> good thngs to solve? (e.g., we should never have generators) If not, why not? I hope to create documents collecting my notes for many of these items and some of the dead-ends that we've encountered trying to fix them.</li>
</ul>
</blockquote>
<p>(As an example here, I know that there are challenges with AsyncDrop-- most notably, what to do in the case of synchronous and how to manage that. I don't think this is an argument against the <em>concept</em> , but it's definitely a major challenge to note down)</p>



<a name="241305358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241305358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241305358">(Jun 02 2021 at 19:10)</a>:</h4>
<p><span class="user-mention" data-user-id="224941">@Carl Lerche</span> I know you've been working on a "what if" sort of story, I"d be curious whether anything in that PR surprises you :)</p>



<a name="241305688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241305688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241305688">(Jun 02 2021 at 19:12)</a>:</h4>
<p>Oh yeah, it is possible to pan and zoom the vision doc SVG in that rendered form, though it's terrible and ugly. Anybody HTML/CSS/JS wizards out there who know how to do it better, I would very much appreciate the help. (And would be happy to show you how it's working now, it's using the <a href="https://github.com/anvaka/panzoom">avanka/panzoom</a> library.</p>



<a name="241329226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241329226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241329226">(Jun 02 2021 at 22:45)</a>:</h4>
<p>The first two items in the "Key goals and points" have got me thinking.... what new concepts will rust async require developers to understand?   i agree that complexities should be largely hidden (pin and poll seem like good examples of that).  but what about concepts like cancellation?   will it end up being important enough that it can't stay hidden?</p>



<a name="241337112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241337112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241337112">(Jun 03 2021 at 00:40)</a>:</h4>
<p>I think the doc points that out - in a good way. You shouldn't be required to understand new concepts. Cancellation can at least be the same as for synchronous code - so it wouldn't be a "new concept".</p>



<a name="241397227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241397227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241397227">(Jun 03 2021 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="222286">@Andrew Chin (eminence)</span> I like that framing</p>



<a name="241397264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241397264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241397264">(Jun 03 2021 at 14:21)</a>:</h4>
<p>I like that a lot :)</p>



<a name="241397293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241397293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241397293">(Jun 03 2021 at 14:21)</a>:</h4>
<p>what is the <em>essential complexity</em> of async required for us to give sufficient control</p>



<a name="241397452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241397452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241397452">(Jun 03 2021 at 14:22)</a>:</h4>
<p>it seems to me (for example) that "tasks" (as a unit of parallelism) <em>may</em> be one of those</p>



<a name="241397518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241397518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241397518">(Jun 03 2021 at 14:23)</a>:</h4>
<p>right now I think you have potential cancellation at every await point, combined with the "things not awaited do not make progress", combined with tasks (concurrency vs parallelism)</p>



<a name="241399034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241399034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241399034">(Jun 03 2021 at 14:34)</a>:</h4>
<p>actually I want to make that list</p>



<a name="241399052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241399052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241399052">(Jun 03 2021 at 14:34)</a>:</h4>
<p>"things an async programmer has to know to be successful"</p>



<a name="241399177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241399177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241399177">(Jun 03 2021 at 14:35)</a>:</h4>
<p><a href="https://hackmd.io/9Ng1PdptQD-yYtHZ9k4qcw">hackmd</a></p>



<a name="241400561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241400561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241400561">(Jun 03 2021 at 14:45)</a>:</h4>
<p>I like the idea of not requiring users to understand the underlying mechanism in order to use async Rust, but it reminded me that this list of items should be balanced with existing Rust values - like zero cost abstractions. For example, it might only be possible through the use of some runtime mechanism to provide an abstraction that saves users from not having to understand some concept - are we willing to introduce that overhead? Probably not.</p>



<a name="241400625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241400625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241400625">(Jun 03 2021 at 14:45)</a>:</h4>
<p>In other words, we should probably somehow restate goals that already exist in Rust's design space that we want to continue to respect.</p>



<a name="241403542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241403542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241403542">(Jun 03 2021 at 15:03)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> see also the work towads <a href="https://hackmd.io/BdumkOYnRfOq0IGxOJKcDw?view">Rust Guiding Principles</a></p>



<a name="241461805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241461805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthias247 <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241461805">(Jun 03 2021 at 22:00)</a>:</h4>
<blockquote>
<p><a href="https://hackmd.io/9Ng1PdptQD-yYtHZ9k4qcw">hackmd</a></p>
</blockquote>
<p>I like that  collection. Added a few comments</p>



<a name="241487119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241487119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sergio <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241487119">(Jun 04 2021 at 03:29)</a>:</h4>
<p>I added some comments as well!</p>



<a name="241534564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241534564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241534564">(Jun 04 2021 at 13:28)</a>:</h4>
<p>Great! I see a ton of comments, I'll take a look</p>



<a name="241534804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241534804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241534804">(Jun 04 2021 at 13:30)</a>:</h4>
<p>I wanted to share this <a href="https://hackmd.io/DPLyLgdgQBGnygVTDeGwVw?view">Async Party Time, Excellent!</a> story outline as well. The aim here was to think about what experience we are shooting for with async (without getting into the full details of how it is achieved). It probably needs some work but I think it hits a lot of the notes I want. </p>
<p>My hope is that this can be a framework where we have different visions for how to achieve these <em>experiences</em> -- e.g., maybe we need async drop for that, or maybe we don't; or maybe we want structured parallelism with "unforgettable futures" (i.e., drive to completion futures)... anyway.</p>



<a name="241571606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/241571606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Doc Jones <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#241571606">(Jun 04 2021 at 17:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis/near/241534804">said</a>:</p>
<blockquote>
<p>I wanted to share this <a href="https://hackmd.io/DPLyLgdgQBGnygVTDeGwVw?view">Async Party Time, Excellent!</a> story outline as well. The aim here was to think about what experience we are shooting for with async (without getting into the full details of how it is achieved). It probably needs some work but I think it hits a lot of the notes I want. </p>
<p>My hope is that this can be a framework where we have different visions for how to achieve these <em>experiences</em> -- e.g., maybe we need async drop for that, or maybe we don't; or maybe we want structured parallelism with "unforgettable futures" (i.e., drive to completion futures)... anyway.</p>
</blockquote>
<p>I'm enjoying just being a consumer of this write up including the comments.  Party on!</p>



<a name="242874901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/Harmonic%20synthesis/near/242874901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ibraheem Ahmed <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/Harmonic.20synthesis.html#242874901">(Jun 16 2021 at 12:49)</a>:</h4>
<p>Rust on Rails <span aria-label="eyes" class="emoji emoji-1f440" role="img" title="eyes">:eyes:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>